import Utils from "../common/Util";
import PopUpManager from "../common/PopUpManager";
import GameManager from "../common/GameManager"

const { ccclass, property } = cc._decorator;

@ccclass
export default class RulePanel extends cc.Component {

    @property(cc.Node)
    ruleBtn: cc.Node
    start() {
        Utils.addEventListener(this.ruleBtn, this.ruleBtnClick.bind(this))
        PopUpManager.Show_ScaleEffect(this.node, 0.2);
    }

    onDestroy() {
        Utils.removeEventListener(this.ruleBtn);
    }

    private ruleBtnClick() {
        GameManager.getInstance().audioManager.PlayBtnSound();
        PopUpManager.Remove_ScaleEffect(this.node, 0.2, "prefab/RulePanel.prefab");
    }
}
